home *** CD-ROM | disk | FTP | other *** search
/ Developer CD Series 1992 June: ROMin Holiday / ADC Developer CD (1992-06) (''ROMin Holiday'')_iso / Developer Connection - 06-1992.iso / Developer Essentials / DTS Sample Code / Macintosh Sample Code / SC.013.OOPTESample / TECommon.h < prev    next >
Encoding:
C/C++ Source or Header  |  1989-09-30  |  5.8 KB  |  159 lines  |  [TEXT/MPS ]

  1. /*---------------------------------------------------------------------
  2. #
  3. #    Apple Macintosh Developer Technical Support
  4. #
  5. #    MultiFinder-Aware Simple TextEdit Sample Application
  6. #
  7. #    OOPTESample
  8. #
  9. #    TECommon.h        -    Constant Defintion
  10. #
  11. #    Copyright © 1988, 1989 Apple Computer, Inc.
  12. #    All rights reserved.
  13. #
  14. #    Version:        
  15. #                    1.10                    10/89
  16. #                    1.00                    04/89
  17. #
  18. #    Components:     
  19. #                    BuildOOPTESample        October 1, 1989
  20. #                    MOOPTESample.p            October 1, 1989
  21. #                    OOPTESample.make        October 1, 1989
  22. #                    TECommon.h                October 1, 1989
  23. #                    TESampleGlue.a            October 1, 1989
  24. #                    TESample.r                October 1, 1989
  25. #                    UApplication.p            October 1, 1989
  26. #                    UApplication.inc1.p        October 1, 1989
  27. #                    UDocument.p                October 1, 1989
  28. #                    UDocument.inc1.p        October 1, 1989
  29. #                    UTEDocument.p            October 1, 1989
  30. #                    UTEDocument.inc1.p        October 1, 1989
  31. #                    UTESample.p                October 1, 1989
  32. #                    UTESample.inc1.p        October 1, 1989
  33. #
  34. ---------------------------------------------------------------------*/
  35.  
  36. #ifndef TECommon_Defs
  37. #define TECommon_Defs
  38.  
  39. /*
  40.     These definitions are shared by Rez and C++. We use #define statements
  41.     instead of constants in this file because Rez doesn't support constants,
  42.     and since the 3.0b1 version of Rez doesn't like the C++ comments, we use
  43.     C style comments in this file as well.
  44.  */
  45.  
  46. /*    Determining an application's minimum size to request from MultiFinder depends
  47.     on many things, each of which can be unique to an application's function,
  48.     the anticipated environment, the developer's attitude of what constitutes
  49.     reasonable functionality and performance, etc. Here is a list of some things to
  50.     consider when determining the minimum size (and preferred size) for your
  51.     application. The list is pretty much in order of importance, but by no means
  52.     complete.
  53.     
  54.     1.    What is the minimum size needed to give almost 100 percent assurance
  55.         that the application won't crash because it ran out of memory? This
  56.         includes not only things that you do have direct control over such as
  57.         checking for NIL handles and pointers, but also things that some
  58.         feel are not so much under their control such as QuickDraw and the
  59.         Segment Loader.
  60.         
  61.     2.    What kind of performance can a user expect from the application when
  62.         it is running in the minimum memory configuration? Performance includes
  63.         not only speed in handling data, but also things like how many documents
  64.         can be opened, etc.
  65.         
  66.     3.    What are the typical sizes of scraps that a user might wish to work
  67.         with when lauching or switching to your application? If the amount
  68.         of memory is too small, the scrap will be purged from memory. This
  69.         can be quite frustrating to the user.
  70.         
  71.     4.    The previous items have concentrated on topics that tend to cause an
  72.         increase in the minimum size to request from MultiFinder. On the flip
  73.         side, however, should be the consideration of what environments the
  74.         application may be running in. There may be a high probability that
  75.         many users with relatively small memory configurations will want to
  76.         avail themselves of your application. Or, many users might want to use it
  77.         while several other, possibly related/complementary applications are
  78.         running. If that is the case, it would be helpful to have a fairly
  79.         small minimum size.
  80.     
  81.     What we did for CPlusTESample:
  82.     
  83.         We determined the smallest heap size that CPlusTESample could have and
  84.         still run (24K). For the preferred size we added enough space to permit:
  85.             a. a maximum size TextEdit text handle (32000 characters)
  86.             b. a maximum usable TextEdit scrap (32000 characters)
  87.             b. a maximum scrap as a result of Copy (32000 characters)
  88.             d. a little performance cushion (see 2, above) (10K)
  89.         Result: 124K for preferred size
  90.         
  91.         For the minimum size we took the 22K and then scaled down our requirements
  92.         for a,b, and c above. We thought that providing 16K more would be lean
  93.         and mean (see 4, above).
  94.         Result: 40K for minimum size
  95. */
  96.  
  97. #define kPrefSize                124
  98. #define kMinSize                40
  99.     
  100. /* kMinHeap - This is the minimum result from the following
  101.      equation:
  102.             
  103.             ORD(GetApplLimit) - ORD(ApplicZone)
  104.             
  105.      for the application to run. It will insure that enough memory will
  106.      be around for reasonable-sized scraps, FKEYs, etc. to exist with the
  107.      application, and still give the application some 'breathing room'.
  108.      To derive this number, we ran under a MultiFinder partition that was
  109.      our requested minimum size, as given in the 'SIZE' resource. */
  110.      
  111. #define    kMinHeap                 (34 * 1024)
  112.     
  113. /* kMinSpace - This is the minimum result from PurgeSpace, when called
  114.      at initialization time, for the application to run. This number acts
  115.      as a double-check to insure that there really is enough memory for the
  116.      application to run, including what has been taken up already by
  117.      pre-loaded resources, the scrap, code, and other sundry memory blocks. */
  118.      
  119. #define    kMinSpace                (20 * 1024)
  120.  
  121. /* id of our STR# for error strings */
  122. #define kTEDocErrStrings     129
  123.  
  124. /* The following are indicies into STR# resources. */
  125. #define    eNoMemory                1
  126. #define    eNoSpaceCut                2
  127. #define    eNoCut                    3
  128. #define    eNoCopy                    4
  129. #define    eExceedPaste            5
  130. #define    eNoSpacePaste            6
  131. #define    eNoWindow                7
  132. #define    eExceedChar                8
  133. #define    eNoPaste                9
  134.  
  135. #define    rMenuBar    128                /* application's menu bar */
  136. #define    rAboutAlert    128                /* about alert */
  137. #define    rDocWindow    128                /* application's window */
  138. #define    rVScroll    128                /* vertical scrollbar control */
  139. #define    rHScroll    129                /* horizontal scrollbar control */
  140.  
  141. /* The following constants are used to identify menus and their items. The menu IDs
  142.    have an "m" prefix and the item numbers within each menu have an "i" prefix. */
  143. #define    mApple                    128        /* Apple menu */
  144. #define    iAbout                    1
  145.  
  146. #define    mFile                    129        /* File menu */
  147. #define    iNew                    1
  148. #define    iClose                    4
  149. #define    iQuit                    12
  150.  
  151. #define    mEdit                    130        /* Edit menu */
  152. #define    iUndo                    1
  153. #define    iCut                    3
  154. #define    iCopy                    4
  155. #define    iPaste                    5
  156. #define    iClear                    6
  157.  
  158. #endif TECommon_Defs
  159.